package com.container.app.testclasses.fileinfo;

import com.container.app.annotations.Component;
import com.container.app.annotations.ImplementationTag;
import com.container.app.annotations.Inject;
import com.container.app.annotations.InstanceTag;

/**
 * Created with IntelliJ IDEA.
 * User: Georgiana.Scarlat
 * Date: 7/12/12
 * Time: 11:54 AM
 */
@SuppressWarnings("UnusedDeclaration")
@Component
public class FileInfoDisplay {

    private String basedir;
    private Integer maxFileNo;
    private FileInfo infoGetter1, infoGetter2;
    private LuckyPick luckyPick;

    @Override
    public String toString() {
        return "FileInfoDisplay{" +
                "basedir='" + basedir + '\'' +
                ", maxFileNo=" + maxFileNo +
                ", infoGetter1=" + infoGetter1 +
                ", infoGetter2=" + infoGetter2 +
                ", luckyPick=" + luckyPick +
                '}';
    }

    @Inject
    public void setLuckyPick(LuckyPick luckyPick) {
        this.luckyPick = luckyPick;
    }

    @Inject
    public void setBasedir(@InstanceTag("basedir") String basedir) {
        this.basedir = basedir;
    }

    @Inject
    public void setInfoGetter2(@ImplementationTag("infoGetter2") FileInfo infoGetter2) {
        this.infoGetter2 = infoGetter2;
    }

    @Inject
    public void setInfoGetter1(@ImplementationTag("infoGetter1") FileInfo infoGetter1) {
        this.infoGetter1 = infoGetter1;
    }

    @Inject
    public void setMaxFileNo(@InstanceTag("maxFileNo") Integer maxFileNo) {
        this.maxFileNo = maxFileNo;
    }

    public String getInfo() {
        return luckyPick.luckyNumber() + ". " + "(max: " + maxFileNo + " )" +
                basedir + infoGetter1.getFileName() + "--" + infoGetter1.getFileSize() + " | " +
                infoGetter2.getFileName() + "--" + infoGetter2.getFileSize();
    }
}
